import java.io.*;

class ExerciseOne {
    static public void main(String args[]) {
        BufferedReader reader = null;
        try {
            String path = getInputPath();
            File file = new File(path);
            reader = new BufferedReader(new FileReader(file));
            String line = null;
            while (null != (line = reader.readLine())) {
                System.out.println(line);
            }
        } catch (Exception e) {
            System.out.println("Exception occured!");
            e.printStackTrace();
        } finally {
            if (reader != null) {
                try {
                    reader.close();
                } catch (IOException e) {
                    System.out.println("Exception occured when close file!");
                    e.printStackTrace();
                }
            }
        }
    }

    static private String getInputPath() throws IOException {
        try {
            BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in));
            System.out.println("Enter an path:");
            return stdin.readLine();
        } catch (IOException e) {
            throw e;
        }
    }
}
